<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class model_city extends CI_Model{
    var $table = "tbl_kasus";
    var $tbl_city = "master_city";
    var $tbl_state = "master_state";
    public function __construct()
    {
        parent::__construct();
    }
    function get_all_propinsi(){
        $q = $this->db->query("SELECT * FROM `master_state`");
        return $q->result();
    }
    function count_city_by_idstate($idstate){
        $q = $this->db->query("SELECT * FROM `$this->tbl_city` WHERE `city_state_id` = '$idstate'");
        return $q->num_rows();
    }
    function get_city_by_idstate($idstate){
        $q = $this->db->query("SELECT * FROM `$this->tbl_city` WHERE `city_state_id` = '$idstate'");
        return $q->result();
    }
    
    
    /*
     * get city data by condition 
     * 141119 dinov
     */
    function get_city_by_condition($condition){
        $this->db->where($condition);
        return $this->db->get($this->tbl_city);
    }
}
/* End of file model_kasus.php */
/* Location: ./application/models/model_kasus.php */
